<?php
/**
 * 会员短消息,发送到一个
 *
 * @version        $Id: member_pmone.php 1 11:24 2010年7月20日Z tianya $
 * @package        DedeCMS.Administrator
 * @copyright      Copyright (c) 2007 - 2010, DesDev, Inc.
 * @license        http://help.dedecms.com/usersguide/license.html
 * @link           http://www.dedecms.com
 */
require_once(dirname(__FILE__)."/config.php");
//检查用户名的合法性
$id = isset($id)? intval($id) : 0;

if(!isset($action)) $action = '';
if($action=="post")
{

	//S$buyid = 'M'.date('YmdHis',time()).mt_rand(100,999);//订单号
	$buyid = 'M'.$mid.'T'.$mtime.'RN'.mt_rand(100,999);
	
	if($type==1){
		$content="管理员手动操作";
		$pname="金币";
	}else{
		$content="管理员手动操作";
		$pname="积分";
	}
	
	$inquery = "INSERT INTO `#@__member_operation`(arcid,mid,oldinfo,money,sjmoney,payment,mtime,txid,buyid,product,pname,sta)
                  VALUES ('0','".$mid."','$content','+".$money."','".$money."','后台操作','".time()."', '$txid','$buyid', 'card','$pname', 2); ";
    //记录定单
     $dsql->ExecuteNoneQuery($inquery);

	if($type==1){
		$dsql->ExecuteNoneQuery("UPDATE `#@__member` SET money = money + '$money' WHERE `mid`='$mid'");
		ShowMsg("成功充值了".$money."金币到该的账户！","member_main.php", 0,8);
	}else{
		$dsql->ExecuteNoneQuery("UPDATE `#@__member` SET scores = scores + '$money' WHERE `mid`='$mid'");
		ShowMsg("成功充值了".$money."积分到该的账户！","member_main.php", 0,8);
	}
	
}

$row = $dsql->GetOne("SELECT * FROM `#@__member` WHERE mid='$id'");

require_once(DEDEADMIN."/templets/member_coin.htm");